1. Field of the Invention
The present invention relates to an encoder which detects position, angle, velocity, angular velocity and the like, especially relates to an interpolation circuit which performs a digital interpolation processing for two-phase sinusoidal signals output from the encoder, thereby outputting two-phase square wave signals with a shorter period than the sinusoidal signals.
2. Prior Art
The grating period of an encoder scale is limited by processing technology. Therefore, in order to achieve a higher revolution than the scale grating, it is necessary to divide and interpolate the spatial phase period of the sinusoidal signal output from the encoder. Various interpolation circuits are currently used.
FIG. 11 shows an example of conventional digital interpolation circuits. The encoder 40 comprises a scale 40a and a read head 40b which is disposed relatively movable to the scale 40a. The read head 40b outputs two-phase sinusoidal signals INA and INB (i.e., A-phase and B-phase signals) corresponding to the relative movement of the scale 40a and the head 40b, which are 90.degree. phase-shifted with each other. The two-phase sinusoidal signals INA and INB are sampled by sample-and-hold circuits 41a and 41b to which a first clock CK1 is supplied, and the resulting sampled values are input to A/D converter 42a and 42b to be converted to digital data DA and DB, respectively. The digital data DA and DB are input to a look-up table memory 43, whereby phase angle data PH, each of which corresponds to the respective sampling phase, are read out from a look-up table memory 43. The phase angle is defined as the following inverse tangent function (ATAN) of the ratio between DA and DB. EQU PH=ATAN (DA/DB) (1)
The correlation between the phase angle data PH and the two-phase sinusoidal signals INA and INB is shown in FIG. 12. The phase angle data PH obtained from the memory 43 are sequentially stored in a register 44, and then transferred to a register 45. A subtracter 46 calculates a differential between the phase angle data and one clock period preceding phase angle data in these registers 44 and 45 to output a differential data DX. The differential data DX is used as interpolation timing pulses for a two-phase square wave generating circuit 47. The two-phase square wave generating circuit 47 is driven by a second clock CK2, which is synchronized with the first clock CK1 and has a higher frequency than the first clock CK1, thereby outputting two-phase square wave signals OUTA and OUTB, state changes of which are synchronized with the differential data DX.
The two-phase square wave generating circuit 47 selects a state transition between four phase (0,0), (1,0), (1,1) and (0,1) for the combination (A,B) of the two-phase square wave signals OUTA and OUTB, based on the polarity and the absolute of the differential data DX, so as to output the two-phase square wave including the information of direction of the scale movement. The state transition is shown in FIG. 13. When the phase angle data PH is increasing (i.e., the differential data DX is positive), the state changes in the "UP" direction shown in FIG. 12 in such a manner of; (0,0).fwdarw.(1,0).fwdarw.(1,1).fwdarw.(0,1). While, when the deferential data DX is negative, the state changes in the "DOWN" direction in such a manner of; (0,0).fwdarw.(0,1).fwdarw.(1,1).fwdarw.(1,0). As a result of the above-described state change, digital two-phase square wave signals are generated.
FIG. 14 shows a schematic diagram of the two-phase square wave signals OUTA and OUTB in such a case that the differential data DX are 0, 1, 5, and 3 in the respective cycle K-1, K, K+1, and IK+2 of the first clock CK1, respectively. Every rising and falling edges of the two-phase square wave signals OUTA and OUTB correspond to interpolation timing pulses. FIG. 14 shows that an external counter count the rising and falling edges of the two-phase square wave signals.
As described above, the conventional interpolation circuit sequentially output the phase angle data PH by the first clock CK1, and performs increasing/decreasing the differential data DX between each two phase angle data, which are one clock period shifted each other, by the second clock CK2, whereby the two-phase square wave signals OUTA and OUTB, which are interpolated with a divisional number defined by the ratio of periods between the first and second clock CK1 and CK2, can be output.
However, as apparent from FIG. 14, the conventional digital interpolation method has a drawback that the interpolation timing pulses are not uniformly distributed. This is because of that the differential data for each clock period is directly increased/decreased by the second clock CK2 the frequency of which is higher than the first clock CK1. The lack of uniformity of the interpolation timing pulse distribution reduces dynamic accuracy of the encoder. That is, the position measuring precision in real time when the encoder is moving is decreased. Especially, in such a case that it is necessary to output a velocity information based on each position difference for a predetermined period in an NC apparatus, the deterioration of the velocity information is a large problem.